<template>
  <div class="father">
    <h2>我是父组件</h2>
    <!--$event 是事件对象-->
    <button @click="test(6, 7, 'happy', $event)">测试</button>
    <Child />
  </div>
</template>

<script setup lang="ts" name="Father">
import Child from "./Child.vue";

function test(a: number, b: number, c: string, d: Event) {
  console.log("test", a, b, c, d);
}
</script>

<style scoped>
.father {
  background-color: rgb(168, 168, 168);
  padding: 20px;
  border-radius: 10px;
}
button {
  margin: 5px;
}
</style>
